<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // var test = 'adsfdasfadsfasdfaadsfas91sfd';
        // var res = test.replace('91','**');
        // console.log(res)
        // var res = test.split('91');
        // console.log(res.join('**'));

        // var test = 'asdf91adsfasd91fadsfas91dfasdfadsfa91sdfa91sdf';

        // var res = test.split('91');
        // console.log(res.join('**'));
        //'asdf**adsfasd91fadsfas91dfasdfadsfa91sdfa91sdf';
        //'asdf**adsfasd**fadsfas91dfasdfadsfa91sdfa91sdf';
        //'asdf**adsfasd**fadsfas**dfasdfadsfa91sdfa91sdf';
        // 判断一个字符在字符串中用 indexOf
        // 判断一个单词在字符串中 用 includes
        // while(test.includes('91')){
        //     test = test.replace('91','**')
        // }
        // console.log(test)


        var point = ['91', '垃圾', '废物'];
        var test = 'asdf91adsfasd91fads垃圾fas91dfasd废物fadsfa91sdfa91sdf';
        // for (var v of point) {
        //     while (test.includes(v)) {
        //         test = test.replace(v, '**')
        //     }
        // }

        // console.log(test)
        // point.forEach(function(item){
        //     test = test.split(item).join('**')
        // });

        // console.log(test);
    </script>
</body>

</html>